import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import {
  ElButton,
  ElContainer,
  ElHeader,
  ElAside,
  ElFooter,
  ElMain,
  ElMenu,
  ElMenuItem,
  ElSubmenu,
  ElForm,
  ElFormItem,
  ElInput,
  ElInputNumber,
  ElBreadcrumb,
  ElBreadcrumbItem,
  ElRadio,
  ElRadioGroup,
  ElDatePicker,
  ElCol,
  ElRow,
  ElSelect,
  ElOption,
  ElCascader,
  ElDialog,
  ElTable,
  ElTableColumn,
  ElPopover,
  ElPagination,
  ElTooltip,
  ElUpload,
  ElAutocomplete,
  ElProgress,
  ElLoading,
  ElScrollbar,
  ElCheckbox,
  ElCheckboxGroup
} from "element-plus";
import "element-plus/lib/theme-chalk/index.css";

//屏幕适配
import "lib-flexible-computer";
import "default-passive-events";

// set language to chinese
//import lang from "element-plus/lib/locale/lang/zh-cn";
//import locale from "element-plus/lib/locale";
// 设置语言
//locale.use(lang);

// 按需引入
const component = [
  ElButton,
  ElContainer,
  ElHeader,
  ElAside,
  ElFooter,
  ElMain,
  ElMenu,
  ElMenuItem,
  ElSubmenu,
  ElForm,
  ElFormItem,
  ElInput,
  ElInputNumber,
  ElBreadcrumb,
  ElBreadcrumbItem,
  ElRadio,
  ElRadioGroup,
  ElDatePicker,
  ElCol,
  ElSelect,
  ElRow,
  ElOption,
  ElCascader,
  ElDialog,
  ElTable,
  ElTableColumn,
  ElPopover,
  ElPagination,
  ElTooltip,
  ElUpload,
  ElAutocomplete,
  ElProgress,
  ElScrollbar,
  ElCheckbox,
  ElCheckboxGroup
];
const app = createApp(App)
  .use(store)
  .use(router)
  .use(ElLoading);

component.forEach(component => {
  app.component(component.name, component);
});

app.mount("#app");
